﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MusicForMvc3.Method.Cache
{
    public class CacheBase<ClassType, ReturnType>
    {
        public virtual string GetData()
        {
            return string.Empty;
        }

        public virtual ReturnType GetObject()
        {
            string json = GetData();
            if (string.IsNullOrWhiteSpace(json))
            {
                return Activator.CreateInstance<ReturnType>();
            }

            return AMing.Helper.Net40.JsonHelper.Deserialize<ReturnType>(json);
        }
    }
}